<?php
$pagename = '用户偏好设置';
include 'header.php';
if(!$_SESSION['login']) {
	echo '<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />';
	echo '<script type="text/javascript">alert("请先登录……");</script>';
	echo '<script type="text/javascript">window.location = "index.php";</script>';
}
?>
		<div id="nav">
			<h1><a href="index.php">NDSOJ</a></h1>
			<ul>
				<li><a href="index.php">首页</a></li>
				<li><a href="problem.php">题库</a></li>
				<li><a href="contest.php">比赛</a></li>
				<li><a href="discuss.php">讨论</a></li>
				<li><a href="help.php">帮助</a></li>
				<li><a href="about.php">关于</a></li>
			</ul>
		</div>
		<div id="mainbox">
			<h2>更改密码</h2>
			<form action="user_prefs_update.php" method="post">
				<p><label for="old_password">原密码</label><input name="old_password" id="old_password" type="password" /></p>
				<p><label for="new_password">新密码</label><input name="new_password" id="new_password" type="password" /></p>
				<p><button type="submit">提交</button></p>
			</form>
			<h2>更改默认配色</h2>
			<form action="user_prefs_update.php" method="post">
				<p><label>选择颜色</label></p>
<?php
include 'var_theme.php';
for($i = 1; $i <= $theme_amount; $i++)
	echo "				<p><input type=\"radio\" name=\"theme\" value=\"$i\" /><span style=\"font-size: 1.2em; margin: auto 5px; color: {$middle[ $i ]};\">■</span>{$name[ $i ]}</p>\n";
?>
				<p><button type="submit">提交</button></p>
			</form>
		</div>
		<div id="sidebar">
<?php include 'module_themeselector.php'; ?>
		</div>
<?php include 'footer.php'; ?>
